﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IPagedList<JLL.China.Model.Listings>>" %>
<%@ Import Namespace="JLL.China.Web.Libraries" %>
<%@ Import Namespace="JLL.China.Model" %>
<div id="table-content-left">
    <div id="pending-post-property-request">
        <!--  start product-table ..................................................................................... -->
        <form id="mainform" class="list_item_form" method="post">
        <table border="0" width="100%" cellpadding="0" cellspacing="0" class="grid" id="product-table">
            <tr>
                <th class="table-header-check">
                    <a id="toggle-all"></a>
                </th>
                <th class="table-header-repeat line-left" style="min-width:88px !important">
                    <a href="">Image</a>
                </th>
                <th class="table-header-repeat line-left">
                    <a href="">Listing Information</a>
                </th> 
                
                <th class="table-header-repeat line-left">
                    <a href="">Listing Detail</a>
                </th>
                  <th class="table-header-repeat line-left">
                    <a href="">Admin Info</a>
                </th>
                 <th class="table-header-repeat line-left">
                    <a href="">Description</a>
                </th>
                <th class="table-header-options line-left">
                    <a href="">Options</a>
                </th>
            </tr>
            <!--  end product-table................................... -->
            <% foreach (var item in Model)
               {%>
            <tr>
                <td valign="middle"  align="center">
                    <input name="selected" type="checkbox" value="<%=item.ID%>" />
                </td>
                <td style="padding:8px">
                <b>Listing For :</b> <%=item.PropertyFor%><br />
                    <a class="thumbnail">
                         <% if (item.HotImage_FID != null)
                           { %>
                             <img src="<%=Url.Content("~/")%>Media/Listings/<%=item.ID+"/thumb/"+item.HotImage_Path%>" />
                        <%}
                           else
                           { %>
                              <img src="<%=Url.Content("~/")%>Content/images/no_img_default.png" />
                        <%} %></a>
                        <br />
                      <b>Listing ID:  </b> <%=item.ID %>
                </td> 
                <td valign="top">
                <ul class="location-listing">
                <li><b>Project name:</b> <%=item.ProjectName%></li>
                <li><b>City:</b> <%=item.City%></li>
                <li><b>Location:</b><%=item.Location%></li>
                <% if (item.SubArea != null)
                   { %>
                <li><b>Subarea:</b><%=item.SubArea%></li>
                <%} %>
                </ul>
                                       
                </td>
               
                <td valign="top">
                   <ul class="location-listing">
                    <li><b>Property Type:</b> <%=item.PropertyTypeName%></li>
                    <li><b>Asking Price:</b>  <%= String.Format("{0:#,##0}", item.AskingPriceLocal)%> RMB</li> 
                    <li><b>Area: </b> <%=String.Format("{0:#,##0}", item.FloorArea_SM)%> sqm</li> 
                  
                  
                </td>
                
                <td valign="top">
                    <ul class="location-listing">
                    <li><b>Creat by:</b> Admin</li>
                    <li><b>Create date:</b><%=item.CreateDate.Value.ToShortDateString()%> <%//=item.CreateDate.Value.ToShortTimeString()%></li> 
                    <li><b>Listing date:</b> <%=item.CreateDate.Value.ToShortDateString()%> <%//=tem.CreateDate.Value.ToShortTimeString()%> </li>    
                    </ul>  
                </td>
                <td valign="top" style="padding:8px;">
                   <%=item.Description%>
                </td> 
                <td class="options-width" valign="top">
                   
                           
                   <div> <a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Step1/<%=item.ID %>"
                            title="View / Edit" class="info-tooltip"><img id="detail-icon-img" src="<%=Url.Content("~/Content/images/")%>File_edit.png"  style="width: 25px; margin-left: 4px;"/></a>
                          <% if (item.StatusFID != 3)
                             { %>
                              <br/>  <br/><a href="<%= Url.Content("~/") %><%= ViewData["now_controller"] %>Delete/<%= item.ID %>?status=<%= item.StatusFID %>"
                            title="Delete" class=" info-tooltip remove-btn-ajax">
                            <img id="Img1" src="<%= Url.Content("~/Content/images/") %>Close.png" style="width: 24px;"/> </a><% } %></div> 
                   
                    <% if (item.StatusFID == 2)
                       { %>
                   <div>
                        <br/>          
                       <a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Active/<%=item.ID %>?status=<%=item.StatusFID %>"
                           title="Set to Active" class="ajaxSubmit info-tooltip">
                            <img id="Img2" src="<%=Url.Content("~/Content/images/")%>Star_full.png" style="width: 28px;" />
                        </a>
                   </div> 
                    <%} %>
                    <% if (item.StatusFID == 1)
                       { %>
                    <div>
                         <br/>           
                        <a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Draft/<%=item.ID %>?status=<%=item.StatusFID %>"
                        title="Set to Draft" class="ajaxSubmit info-tooltip">
                              <img id="Img3" src="<%=Url.Content("~/Content/images/")%>Cancel.png" style="width: 24px;margin-left: 2px" />
                      </a>
                    </div>
                    <%} %>
                    <% if (item.StatusFID == 3)
                       { %>
                    <div>  <br/>  
                        <a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Active/<%=item.ID %>?status=<%=item.StatusFID %>"
                        title="Set to Active" class="ajaxSubmit info-tooltip">
                       
                        <img id="Img4" src="<%=Url.Content("~/Content/images/")%>Star_full.png" style="width: 28px;" /></a>
                      </div>
                    <div> <br/> 
                        <a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Draft/<%=item.ID %>?status=<%=item.StatusFID %>"
                        title="Set to Draft" class="ajaxSubmit info-tooltip">
                        <img id="Img5" src="<%=Url.Content("~/Content/images/")%>Cancel.png" style="width: 24px;margin-left: 2px" />
                            
                         </a>
                    </div>
                      
                       
                    <%} %>
                         <div>
                              <br/> 
<a href="<%=JLL.China.Web.Libraries.HelperUtility.PortalUrl()%>listing/detail/sqm/<%=item.ID%>" class="preview" data-fancybox-type="iframe" title="Preview">
<img alt="search icon" src="<%=Url.Content("~/Content/images/")%>Search.png"  style="width: 28px;">
</a>
                      </div>
                    
                 
                    
                </td>
            </tr>
            <%} %>
        </table>
        <!--  start actions-box ............................................... -->
        <div id="actions-box">
            <a href="" class="iconaction icon-cog"> </a>
            <a href="" class="action-slider"></a>
            <div id="actions-box-slider">
                <% if (Int32.Parse((ViewData["ListStatus"] != null) ? ViewData["ListStatus"].ToString() : "0") != 1)
                   {%>
                   <a class="iconaction icon-ok-sign"></a>
                <a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>BulkProcess/Active"
                    title="Set selected status to active" class="action-edit action-invoke info-tooltip">
                    Active</a>
                <%} %>
                <% if (Int32.Parse((ViewData["ListStatus"] != null) ? ViewData["ListStatus"].ToString() : "0") != 2)
                   {%>
                   <a class="iconaction icon-ban-circle"></a>
                <a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>BulkProcess/Draft"
                    title="Set selected status to Draft" class="action-edit  action-invoke info-tooltip">
                    Draft</a>
                <%} %>
                <% if (Int32.Parse((ViewData["ListStatus"] != null) ? ViewData["ListStatus"].ToString() : "0") != 3)
                   {%>
                   <a class="iconaction icon-trash "> </a>
                <a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>BulkProcess/Delete"
                    title="Delete selected" class="action-edit action-invoke-removed info-tooltip" />
                Delete</a>
                <%} %>
            </div>
           
            <div class="clear">
            </div>
        </div>
          <%Html.RenderPartial("PerPage", ViewData);%>
        <!-- end actions-box........... -->
        <!--  start paging..................................................... -->
        <table border="0" cellpadding="0" cellspacing="0" id="paging-table">
            <tr>
                <td class="page-cell">
                    <div class="pager">
                        <%= Html.Pager(ViewData.Model.PageSize, ViewData.Model.PageNumber, ViewData.Model.TotalItemCount) %>
                    </div>
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                  
                </td>
            </tr>
        </table>
        <!--  end paging................ -->
        </form>
        <div class="clear">
        </div>
    </div>
    <!-- end pending-post-property-request -->
</div>
<!-- end table-content-left -->
